package com.dnw.presenter;

import com.dnw.base.BasePresenter;
import com.dnw.modle.Result;
import com.dnw.view.IApprovedView;
import com.socks.library.KLog;

import rx.Subscriber;

/**
 * Created by yangyu on 2017/11/20.
 */

public class ApprovedPresenter extends BasePresenter<IApprovedView> {
    public ApprovedPresenter(IApprovedView view) {
        super(view);
    }

    public void getIsApprovedResult() {
        addSubscription(mApiService.getIsApproved(), new Subscriber<Result>() {
            @Override
            public void onCompleted() {
            }

            @Override
            public void onError(Throwable e) {
                e.printStackTrace();
                KLog.e(e.getLocalizedMessage());
                mView.onError();
            }

            @Override
            public void onNext(Result result) {
                mView.onGetPassedSuccess(result);
            }
        });
    }

}
